<template>
	<div>
		<form action="" method="post">
			<!-- autocomplete  自动保存 上次输入的数据 -->
			用户名 <input type="text" autocomplete="on" placeholder="用户名"  v-model="username" /> <br />
			密码 <input type="password" autocomplete="on" placeholder="密码" v-model="password" /> <br />
		</form>
		<button @click="submit" > 提交</button>
	</div>
</template>

<script setup>
import { ref } from 'vue';
// axios node 环境下的 控制 http的访问
const axios = require('axios');
let username = ref("")
let password = ref("")
// 将数据提交到后台
let submit = function () {
	axios.get(`http://192.168.134.3:3000/send?username=${username.value}&password=${password.value}`).then((result) => {
		console.log(result.data);
	}).catch((err) => {
		
	});
}

</script>

<style  scoped></style>